#!/usr/bin/env python
#coding=utf-8
'''
Created on Jul 23, 2010

@author: lxd
'''
import wx
import bin_rss
import bin_user
import bin_twitter
import bin_twitter_message
import bin_proxy

class PageSet(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        self.btnUser = wx.Button(self, -1, u'用户设置') 
#        self.btnRss = wx.Button(self, -1, u'博客设置') 
#        self.btnMessage = wx.Button(self, -1, u'留言设置') 
        self.btnTwitter = wx.Button(self, -1, u'查看迷你博客') 
        self.btnTMessage = wx.Button(self, -1, u'迷你博客留言设置') 
        self.btnProxy = wx.Button(self, -1, u'代理设置') 
        self.btnSizer = self.createBtnSizer()  
     
        self.layout()
        self.Bind(wx.EVT_BUTTON, self.OnUserClick, self.btnUser)        
#        self.Bind(wx.EVT_BUTTON, self.OnRssClick, self.btnRss) 
#        self.Bind(wx.EVT_BUTTON, self.OnMessageClick, self.btnMessage) 
        self.Bind(wx.EVT_BUTTON, self.OnTwitterClick, self.btnTwitter) 
        self.Bind(wx.EVT_BUTTON, self.OnTMessageClick, self.btnTMessage) 
        self.Bind(wx.EVT_BUTTON, self.OnProxyClick, self.btnProxy) 
        
    def createBtnSizer(self):
        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
        btnSizer.Add(self.btnUser, 0, wx.ALL, 5)
#        btnSizer.Add(self.btnRss, 0, wx.ALL, 5)
#        btnSizer.Add(self.btnMessage, 0, wx.ALL, 5)
        btnSizer.Add(self.btnTwitter, 0, wx.ALL, 5)
        btnSizer.Add(self.btnTMessage, 0, wx.ALL, 5)
        btnSizer.Add(self.btnProxy, 0, wx.ALL, 5)
        return btnSizer
    
    def layout(self):
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(self.btnSizer, 0, wx.ALL | wx.EXPAND, 5)
        self.SetSizer(mainSizer)
        mainSizer.Fit(self)
        mainSizer.SetSizeHints(self)  
        
    def OnUserClick(self, event): 
        user = bin_user.MainFrame()
        user.ShowModal() 
                            

#    
#    def OnRssClick(self, event): 
#        rss = bin_rss.MainFrame()
#        rss.Show() 
#    def OnMessageClick(self, event): 
#        pass# 

      
    def OnTwitterClick(self, event): 
        twitter = bin_twitter.MainFrame()
        twitter.Show() 
        
    def OnTMessageClick(self, event): 
        tmessage = bin_twitter_message.MainFrame()
        tmessage.Show() 
        
    def OnProxyClick(self, event): 
        proxy = bin_proxy.MainFrame()
        proxy.Show() 
